package com.cc.proxy;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
//接口----证
public class SpringHk  implements MethodInterceptor{//spring黑客类
    //入侵的方法:MethodInvocation目标执行者
    @Override
    public Object invoke(MethodInvocation invocation)throws Throwable {
        System.out.println("黑客入侵前");   
        System.out.println("鉴权成功！！");
        Object[]  params=invocation.getArguments();
        //修改方法参数值
        params[0]=100;
        params[1]=2;
        Object object = invocation.proceed();//调用目标方法
        System.out.println("记录日志成功！！");
        System.out.println("黑客入侵后");
        return object;
    }
}
